package com.ficus.road.maintain.core.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Builder;
import lombok.Data;
import org.apache.catalina.LifecycleState;

import java.util.List;

@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class RoadPerceptionResult {
    Point point;
    RelPoint relPoint;

    RelBbox relBbox;
    Bbox bbox;
    List<Point> outline;
    RoadPerceptionType perceptionType;

    public enum RoadPerceptionType {
        //栅栏分析结果
        PIC_FENCE_RESULT("PIC_FENCE_RESULT"),

        //交通黄线分析结果
        PIC_TRAFFIC_YELLOW_LINE_RESULT("PIC_TRAFFIC_YELLOW_LINE_RESULT"),

        //交通标志分析结果
        PIC_TRAFFIC_SIGN_RESULT("PIC_TRAFFIC_SIGN_RESULT"),

        //交通白线分析结果
        PIC_TRAFFIC_WHITE_LINE_RESULT("PIC_TRAFFIC_WHITE_LINE_RESULT"),

        //井盖
        PIC_MANHOLE_COVER_RESULT("PIC_MANHOLE_COVER_RESULT"),

        //交通信号灯
        PIC_TRAFFIC_LIGHT_RESULT("PIC_TRAFFIC_LIGHT_RESULT"),

        //交通杆
        PIC_POLE_RESULT("PIC_POLE_RESULT"),

        //交通箭头
        PIC_TRAFFIC_ARROW_RESULT("PIC_TRAFFIC_ARROW_RESULT"),

        //斑马线
        PIC_ZEBRA_RESULT("PIC_ZEBRA_RESULT"),

        //停止线
        PIC_STOP_LINE_RESULT("PIC_STOP_LINE_RESULT"),

        //PIC_CURBSTONE_RESULT
        PIC_CURBSTONE_RESULT("PIC_CURBSTONE_RESULT"),
        PIC_PEDESTRIAN_RESULT("PIC_PEDESTRIAN_RESULT"),
        PIC_RIDER_RESULT("PIC_RIDER_RESULT"),
        PIC_MOTORIZED_VEHICLE_RESULT("PIC_MOTORIZED_VEHICLE_RESULT"),
        PIC_NON_MOTORIZED_VEHICLE_RESULT("PIC_NON_MOTORIZED_VEHICLE_RESULT")

        ;

        private String value;

        RoadPerceptionType(String value) {
            this.value = value;
        }

        @JsonCreator
        public static RoadPerceptionType fromValue(String value) {
            for (RoadPerceptionType b : RoadPerceptionType.values()) {
                if (b.value.equals(value)) {
                    return b;
                }
            }
            throw new IllegalArgumentException("Unexpected value '" + value + "'");
        }

        @Override
        @JsonValue
        public String toString() {
            return String.valueOf(value);
        }

    }
}
